package day11;

import com.mysql.jdbc.Connection;

import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionDemo {
    public static void main(String[] args) throws SQLException {

        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        Connection conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/g2148?useSSL=false&useUnicode=true&characterEncoding=utf-8", "root", "123456");
        System.out.println("conn:" + conn);

        conn.close();
    }
}
